Skip to content

test: add integration test for unlock happy path against mock contract - #592

Merged
barry01-hash merged 3 commits into
PromptMintLabs:mainfrom
Kriss255:fix/issue-450-add-integration-test-for-unlock-happy-path
Sep 3, 2026
Merged

test: add integration test for unlock happy path against mock contract#592
barry01-hash merged 3 commits into
PromptMintLabs:mainfrom
Kriss255:fix/issue-450-add-integration-test-for-unlock-happy-path

Conversation

@Kriss255

Copy link
Copy Markdown
Contributor

Overview

This PR adds an integration test that exercises the challenge → sign → unlock happy path for the prompt-hash contract against a mocked has_access contract, guarding regressions in the unlock flow without depending on real access-control state.

Related Issue

Changes

🧪 Unlock Happy Path Integration Test

  • [ADD] contracts/prompt-hash/src/mock_has_access.rs

    • Minimal mock contract exposing a controllable has_access function.
    • Returns true for the test signer so the unlock happy path can complete.
  • [MODIFY] contracts/prompt-hash/src/test.rs

    • Adds challenge -> sign -> unlock integration test.
    • Asserts the full happy path succeeds end-to-end.
    • Verifies a denied has_access would cause the unlock to fail, protecting the regression guard.
  • [MODIFY] contracts/prompt-hash/src/lib.rs

    • Wires the mock has_access contract into the test-only build.
    • Keeps production unlock behavior unchanged.

Verification Results

cargo test -p prompt-hash
✅ 3/3 passed

Integration acceptance check:
✅ challenge -> sign -> unlock completes successfully
✅ mock has_access authorizes the test signer
✅ unlock happy path is guarded against has_access regressions
Acceptance Criteria Status
Add integration test for unlock happy path challenge -> sign -> unlock covered and passing
Use mocked has_access to guard regressions ✅ Mock contract returns authorized for the test signer
Changes are limited to test/mock wiring ✅ Only test.rs, mock_has_access.rs, and test wiring in lib.rs changed
Existing unlock behavior is preserved ✅ Production logic untouched; mock is test-only

Closes #450

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Kriss255 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@barry01-hash
barry01-hash merged commit 084137a into PromptMintLabs:main Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration test for unlock happy path against mock contract

2 participants